import request from '@/utils/request'


/*
 *首页-用户数据
 */

export function fetchHome() {
  return request({
    url: '/report/index',
    method: 'get'
  })
}

/*
 *首页-用户图表数据
 */

export function fetchHomeChart(params) {
  return request({
    url: '/report/user/statistics',
    method: 'get',
    params
  })
}


/*
 *首页-销售统计
 */

export function fetchOvuolaData(params) {
  return request({
    url: '/report/sales/statistics',
    method: 'get',
    params
  })
}

/*
 *首页-销售统计图表数据
 */

export function fetchOvuolaChartData(params) {
  return request({
    url: '/report/sales/statisticsSearch',
    method: 'get',
    params
  })
}

/*
 *首页-销售统计-图表
 */

export function fetchOvuolaDataDetail(params) {
  return request({
    url: '/report/sales/statisticsDetail',
    method: 'get',
    params
  })
}

/**
 * 返回一个生理周期的激素值列表
 */

export function physiologicals(params) {
  return request({
    url: '/users/physiologicals/list',
    method: 'get',
    params
  })
}

/**
 * 获取所有例假开始周期
 */

export function allPeriod(params) {
  return request({
    url: '/users/' + params.userId + '/menstruation/info',
    method: 'get'
  })
}

/**
 * 获取排卵日期
 */

export function ovuPeriod(params) {
  return request({
    url: '/users/record/ovuPeriod',
    method: 'get',
    params
  })
}

/**
 * 获取指定周期图表渲染参数
 */

export function advancedQuery(params) {
  return request({
    url: '/users/physiologicals/advancedQuery/list',
    method: 'get',
    params
  })
}

/**
 * 添加VIP参数
 */

export function vipDataQuery(params) {
  return request({
    url: '/users/peak/addVip2/query',
    method: 'get',
    params
  })
}


/**
 * APP行为数据-行为事件
 */

export function fetchAnalyzeData() {
  return request({
    url: '/analyze/behaviorData',
    method: 'get'
  })
}

/**
 * APP行为数据-行为事件详情
 */

export function fetchAnalyzeDetail(params) {
  return request({
    url: '/analyze/behaviorDetail',
    method: 'get',
    params
  })
}
